<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
</head>
<body>
    <button>fetch-ajax请求</button>

    <script>
        let btn = document.getElementsByTagName("button")[0]
        btn.onclick = function(){
            // alert(1)
            fetch('http://127.0.0.1:8085/fetch-server?a=1',{
                method:'post',
                headers:{ 
                    name:"su"
                },
                body:'username=suliang&password=124558'
            }).then(value=>{
                return value.json();
            }).then(value=>{
                console.log(value);
            })
        }
    </script>
</body>
</html>